#include <iostream>
#include <utility>
#include <tuple>

using namespace std;

int main()
{
	int a = 0;
	int b = 0;
	int c = 0;
	int d = 0;

	pair<reference_wrapper<int>, reference_wrapper<int>> pr(piecewise_construct, tuple<int&>(a), tuple<int&>(b));
	pr.first.get() = 1;
	pr.second.get() = 2;
	cout << a << "," << b << "," << c << "," << d << endl;

	pr = make_pair(reference_wrapper<int>(c), reference_wrapper<int>(d));
	pr.first.get() = 3;
	pr.second.get() = 4;
	cout << a << "," << b << "," << c << "," << d << endl;

	const int e = 0;
	reference_wrapper<const int> rwE(e);
	cout << rwE << endl;
	int f = 0;
	reference_wrapper<const int> rwF(f);
	cout << rwF << endl;
	return 0;
}